package com.Cfeng.XiaohuanChat.repository;

import com.Cfeng.XiaohuanChat.entity.ChatMessage;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * @author Cfeng
 * @date 2022/8/6
 */

public interface ChatMessageRepository extends MongoRepository<ChatMessage,String> {
    //查询聊天记录10条Reciver为null
    List<ChatMessage> findTop10ByReceiverIsNullOrderByCreateTimeDesc();

    //根据内容模糊查询
    ChatMessage findByContentContaining(String content);
}
